import java.util.Arrays;

//编写类A03，实现数组的复制功能copyArr，输入旧数组，返回一个新数组，元素和旧数组一样
public class Homework14 {
    public static void main(String[] args) {
        A03 a03 = new A03();
        int[] arr = {10, 50, 20, 70, 5, 7};
        int[] newArr = a03.copyArr(arr);
        System.out.println(Arrays.toString(newArr));
        System.out.println("旧数组地址：" + arr);
        System.out.println("新数组地址：" + newArr);
    }
}

class A03 {
    public int[] copyArr(int[] oldArr) {
        int[] newArr = new int[oldArr.length];
        for (int i = 0; i < oldArr.length; i++) {
            newArr[i] = oldArr[i];
        }
        return newArr;
    }
}
